<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page isELIgnored="false" %>

<%--用jsp填充input输入框--%>

<!DOCTYPE html>
<html>
<head>
    <title>用户信息表单</title>
    <style>
        /* 简单样式，让表单看起来美观 */
        table {
            border-collapse: collapse;
            width: 80%;
            margin: 20px auto;
        }

        th, td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: center;
        }

        th {
            background-color: #f4f4f4;
        }

        input[readonly] {
            background-color: #f9f9f9;
            border: none;
            text-align: center;
        }

        form {
            margin: 20px auto;
            width: 80%;
        }

        button {
            display: block;
            margin: 20px auto;
            padding: 10px 20px;
            background-color: #ccc;
            border: none;
            cursor: not-allowed;
            color: #666;
        }

        button:disabled {
            background-color: #f0f0f0;
        }
    </style>
</head>
<body>
<h1 style="text-align: center;">用户信息表单</h1>

<form onsubmit="return false;">
    <table>
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>年龄</th>
        </tr>
        <c:forEach var="user" items="${users}">
            <tr>
                <td><input type="text" name="id" value="${user.id}" readonly></td>
                <td><input type="text" name="name" value="${user.name}" readonly></td>
                <td><input type="text" name="age" value="${user.age}" readonly></td>
            </tr>
        </c:forEach>
    </table>
    <!-- 禁用提交按钮 -->
    <button type="submit" disabled>提交表单</button>
</form>

</body>
</html>